import {} from 'react'
import style from './index.module.less'
import PageComponent from '@components/pageComponent'
import { ErrorBlock } from 'antd-mobile'
import { useHistory } from 'react-router-dom'
import { useAppDispatch } from '@src/redux/hook'
import { pop } from '@src/redux/reducers/pages'

function Main ({ noHistory = false }) {
  const h = useHistory()
  const dispatch = useAppDispatch()
  return (
    <PageComponent title='错误提示' onBack={() => noHistory ? dispatch(pop()) : h.replace('/')}>
      <div className={style.container}>
        <ErrorBlock status='empty' title='页面不存在' description='' fullPage />
      </div>
    </PageComponent>
  )
}

export default Main
